﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VisualPoint.Controls.Actions
{
    public class OpenFileAction : BaseAction
    {

        public override string Name
        {
            get 
            {
                return "Open File";
            }
        }

        public override string Description
        {
            get 
            {
                return "Opens a the editor window of a File";
            }
        }

        public override string Help
        {
            get 
            {
                return Description;
            }
        }

        private string _project;
        public string Project 
        {
            get
            {
                return _project;
            }
            set
            {
                if (_project != value)
                {
                    _project = value;
                    DoPropertyChanged("Project");
                }
            }
        }

        private string _fileName;
        public string FileName
        {
            get
            {
                return _fileName;
            }
            set
            {
                if (_fileName != value)
                {
                    _fileName = value;
                    DoPropertyChanged("FileName");
                }
            }
        }

        private string _folder;
        public string Folder
        {
            get
            {
                return _folder;
            }
            set
            {
                if (_folder != value)
                {
                    _folder = value;
                    DoPropertyChanged("Folder");
                }
            }
        }

        public override void Run()
        {
            VisualPoint.Controls.Environments.Environment.Current.OpenDocument(Project, Folder, FileName);
        }
    }
}
